<?php
use Illuminate\Database\Eloquent\SoftDeletingTrait;

class MainCategory extends Eloquent {

	use SoftDeletingTrait;
	
	protected $dates = ['deleted_at'];
		
	protected $table = 'main_category';
	 
	/**
	 * Retrieves Categories under Main Category.
	 * Usage: MainCategory::find(3)->categories, MainCategory::has('categories')
	 * @author AngelaMisa 03/11/2015 6:25AM
	 * @return mixed
	 */
	 public function categories() {
	 	return $this->belongsToMany('Category', 'main_category_category', 'MAIN_CATEGORY_id', 'CATEGORY_id');
	 }
}